#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int N = 2e4 + 5;
const int M = 1e9 + 7;

int t, n;
string s;

int main()
{
#ifdef LOCAL
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    ios::sync_with_stdio(false), cin.tie(0);
    cin >> t;
    while (t--)
    {
        cin >> n >> s;
        s = "#" + s;
        int m = n / 2;
        int flag = false;
        for (int i = m+1; i <= n; i++)
        {
            if (s[i] == '0')
            {
                flag = true;
                cout << 1 << ' ' << i << ' ' << 1 << ' ' << i - 1 << endl;
                break;
            }
        }

        if (flag)
            continue;

        if (s[m] == '1')
        {
            cout << m << ' ' << n - 1 << ' ' << m + 1 << ' ' << n << endl;
        }
        else
        {
            cout << m << ' ' << n << ' ' << m + 1 << ' ' << n << endl;
        }
    }
    return 0;
}